package com.bdqn.web.controller;

import com.alibaba.fastjson.JSON;
import com.bdqn.web.entity.Comment;
import com.bdqn.web.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServlet;
import java.util.List;

@Controller
public class UserController extends HttpServlet {

    @Autowired
    CommentService commentService;

    @RequestMapping("/selectAll")
public String selectAll(Model model){
        List<Comment> list = commentService.selectAllComment();
        model.addAttribute("list",list);
        return "index";
    }
}
